﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Services;
using Volo.Abp.Domain.Repositories;

namespace MyEartags.PairVariety
{
    public class VarietiesAppService : ApplicationService, IVarietiesAppService
    {
        private readonly IRepository<Varieties, int> _varietyRepository;

        public VarietiesAppService(IRepository<Varieties, int> varietyRepository)
        {
            _varietyRepository = varietyRepository;
        }

        /// <summary>
        /// 获取所有对应品种
        /// </summary>
        /// <returns></returns>
        public async Task<List<VarietiesDto>> GetVarietiesList()
        {
             var list = await _varietyRepository.GetListAsync();
            return ObjectMapper.Map<List<Varieties>, List<VarietiesDto>>(list);
        }
    }
}
